package cn.tedu.tmall.admin.mall.dao.repository;

import cn.tedu.tmall.admin.mall.pojo.po.MallCategoryPO;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;

import java.util.List;

public interface IMallCategoryRepository {

    Long countCategoryByName(String name);

    void save(MallCategoryPO categoryPO);

    MallCategoryPO getCategoryById(@NotNull(message = "父类别ID不能为空") @Min(value = 1, message = "父类别ID必须大于等于1") Long parentId);

    void updateCategoryById(MallCategoryPO update);

    List<MallCategoryPO> listCategoryByPrentId(Long parentId);

    List<MallCategoryPO> getAll();
}
